//
//  Common.h
//  Medicare
//
//  Created by admin on 16/5/6.
//  Copyright © 2016年 iflytek. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AppDelegate.h"

@interface Common : NSObject

+ (void)getInitedSpeechRecognizer;

+ (UIColor *)hexToColor:(NSString *)str;

+ (AppDelegate *)getDelegate;

+ (NSString *)cachPath;

+ (id)jsonToObject:(NSString *)jsonStr;

+ (NSString *)objectToJson:(id)obj;

+ (void)processPrivateCloudIPWithString:(NSString *)string;

+ (UIImage *)blurredImageWithImage:(UIImage *)image;

+ (UIImage *)snapshot:(UIView *)view;

+ (BOOL) isPropertyAvailableWithClass:(Class) myClass varName:(NSString *)name;
//获取当前vc
+ (UIViewController *)getPresentedViewController;
//添加页面第一次引导
+ (BOOL)addGuideWithImage:(UIImage *)image
                       vc:(UIViewController *)vc
       guideDefaultString:(NSString *)defaultString
                 selector:(SEL)selector;
//给textfield设定自定义的clearbutton图标
+ (void)setTextFieldClearButtonWithSuperView:(UIView *)superView;
//给textview的光标位置插入某个字符，eg:传@"" 传"\n"
+ (void)exchangeString:(NSString *)newString withTextView:(UITextView *)textView isBackward:(BOOL)isBackward;
+ (NSString *)firstCharactor:(NSString *)aString;
+(UIImage *) imageWithColor:(UIColor*)color andHeight:(CGFloat)height;

+ (NSArray *)searchWithAllFieldArray:(NSArray *)allFieldArray
                         inputString:(NSString *)inputString
                          inAllArray:(NSArray *)allArray;
+ (NSArray *)searchWithFieldArray:(NSArray *)fieldArray
                      inputString:(NSString *)inputString
                          inArray:(NSArray *)array;
#pragma mark 数组排序
+ (NSMutableArray *)sortFirstStrWithArray:(NSArray *)array;

+ (BOOL) isEmpty:(NSString *)str;

//圆角矩形
+(UIImage *)drawRectangle:(CGRect)rect withRadius:(float)radius AndwithLineWidth:(CGFloat )lineWidth AndwithLineColor:(UIColor *)lineColor AndwithFillColor:(UIColor *)fillColor;

//保存图片
+(void)saveImageDocuments:(UIImage *)image AndImageName:(NSString *)name;

// 读取并存贮到相册
+(UIImage *)getDocumentImageAndImageName:(NSString *)pictureName;

//MD5加密
+ (NSString *)md5:(NSString *)input;

+(NSString *) connectUrl:(NSDictionary *)params url:(NSString *) urlLink;

//获取当前时间
+ (NSString *)getCurrentDateWithTheDateFormat:(NSString *)dateFormatString;
//获取两个日期之间相差的天数
+ (NSInteger)numberOfDaysWithFromDate:(NSDate *)fromDate toDate:(NSDate *)toDate;

+(BOOL) isBlankString:(NSString *)string;
@end
